const Controller = require("../core/base");
const Model = require("../model/index");

class BannerListController extends Controller {
    async getBannerList() {
        const { ctx } = this;
        const body = ctx.request.body;

        try {
            const rows = await Model.BannerList.findAll({
                where: {
                    pos: body.pos
                }
            });
            this.success(rows);
        } catch(err) {
            this.fail(err);
        }
    }
}

module.exports = BannerListController;